from tkinter import *

root = Tk()

Label(root, text='股票代码：').grid(row=0, column=0)  # 选项row代表行，column代表列
Label(root, text='起始时间 (XXXX-XX-XX)：').grid(row=1, column=0)
Label(root, text='终止时间（XXXX-XX-XX)：').grid(row=2, column=0)
Label(root, text='交易佣金：').grid(row=3, column=0)
Label(root, text='印花税：').grid(row=4, column=0)
Label(root, text='是否允许止损（是or否）：').grid(row=5, column=0)
Label(root, text='止损价：').grid(row=6, column=0)
Label(root, text='止损幅度：').grid(row=7, column=0)
Label(root, text='最大止损次数：').grid(row=8, column=0)
Label(root, text='资金量：').grid(row=9, column=0)

e1 = Entry(root)
e2 = Entry(root)
e3 = Entry(root)
e4 = Entry(root)
e5 = Entry(root)
e6 = Entry(root)
e7 = Entry(root)
e8 = Entry(root)
e9 = Entry(root)
e10 = Entry(root)
e1.grid(row=0, column=1, padx=10, pady=5)
e2.grid(row=1, column=1, padx=10, pady=5)
e3.grid(row=2, column=1, padx=10, pady=5)
e4.grid(row=3, column=1, padx=10, pady=5)
e5.grid(row=4, column=1, padx=10, pady=5)
e6.grid(row=5, column=1, padx=10, pady=5)
e7.grid(row=6, column=1, padx=10, pady=5)
e8.grid(row=7, column=1, padx=10, pady=5)
e9.grid(row=8, column=1, padx=10, pady=5)
e10.grid(row=9, column=1, padx=10, pady=5)

def show():
    print(e1.get(),e2.get(),e3.get(),e4.get(),e5.get(),e6.get(),e7.get(),e8.get(),e9.get(),e10.get())


Button(root, text='确认', width=10, command=show) \
    .grid(row=10, column=0, sticky=W, padx=10, pady=5)
Button(root, text='退出', width=10, command=root.quit) \
    .grid(row=10, column=1, sticky=E, padx=10, pady=5)

mainloop()

code = e1.get()  # 股票代码
start_date = e2.get()  # 起始时间
end_date = e3.get()  # 终止时间
money = e10.get()  # 初始资金
trading_Commission = e4.get()  # 交易佣金
stamp_duty = e5.get()  # 印花税
stop_loss_on = e6.get()  # 是否允许止损
priceStopLoss = e8.get()  # 止损价
stop_loss_range = e8.get()  # 止损幅度
stop_loss_max = e9.get()  # 最大允许止损次数. 到止损次数,就停止交易